package com.goldenlight.fvms.manager.service.impl;

import com.goldenlight.fvms.manager.dao.FreeApplyDao;
import com.goldenlight.fvms.manager.entity.ProductFreeApply;
import com.goldenlight.fvms.manager.dao.ProductFreeApplyDao;
import com.goldenlight.fvms.manager.service.ProductFreeApplyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 生产生活车辆申请信息表 服务实现类
 * </p>
 *
 * @author luocx
 * @since 2018-12-08
 */
@Service
public class ProductFreeApplyServiceImpl extends ServiceImpl<ProductFreeApplyDao, ProductFreeApply> implements ProductFreeApplyService {
    @Autowired
    private ProductFreeApplyDao productFreeApplyDao;
    @Autowired
    private FreeApplyDao freeApplyDao;
    @Override
    public int qryCount(Map<String, Object> qryMap) {
        return productFreeApplyDao.qryCount(qryMap);
    }
    @Transactional
    @Override
    public int delete(String buildVersion) {
        Map<String,Object> map = new HashMap<>();
        map.put("build_version", buildVersion);
        freeApplyDao.deleteByMap(map);
        return productFreeApplyDao.deleteByMap(map);
    }

    @Override
    public List<Map<String, Object>> qryProductCountInfo() {
        return productFreeApplyDao.qryCountInfo();
    }
}
